Skip to content

feat: add Sentry.Quartz3 for cron monitoring of Quartz.NET 3.x jobs - #5668

Merged
jamescrosswell merged 69 commits into
mainfrom
danf/quartz-crons
Oct 29, 2026
Merged

jamescrosswell merged 69 commits into
mainfrom
danf/quartz-crons

Conversation

@wedamija

@wedamija wedamija commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Changelog Entry

  • Add Sentry.Quartz3, an integration for Quartz.NET 3.x (3.6 and later) on .NET Framework 4.6.2+ and .NET 8+
    • Register it with services.AddQuartz(q => q.AddJobListener<SentryJobListener>()) or scheduler.ListenerManager.AddJobListener(new SentryJobListener())
    • Jobs marked with [SentryMonitorSlug] send a Sentry Crons check-in for every run, with the trigger's cron or interval schedule as the monitor config, so monitors are created and kept up to date automatically
    • Quartz.NET 3.x has no job middleware, so unlike Sentry.Quartz this doesn't run each job in its own scope or capture the exceptions jobs throw

Description

Part of a series adding automatic Crons monitoring for the most-used job schedulers in each SDK. Check-ins for a monitor that doesn't exist yet are dropped, so today each monitor has to be created by hand with its schedule copied from the code. Sending the job's schedule as the monitor config lets Sentry create the monitor and keep it in sync.

Adds Sentry.Quartz3, the Quartz.NET 3.x version of Sentry.Quartz. Quartz 4 only targets net10.0, so apps on .NET Framework or older .NET stay on Quartz 3. It builds the shared core files against Quartz [3.6.0,4.0.0) for net8.0 to net10.0 and net462, and runs them from an IJobListener because Quartz 3 has no job middleware.

services.AddQuartz(q => q.AddJobListener<SentryJobListener>());
// or: scheduler.ListenerManager.AddJobListener(new SentryJobListener());

As in Sentry.Quartz, jobs with [SentryMonitorSlug] send check-ins with their trigger's schedule unless SendMonitorConfig is off. A listener can't wrap the job, so there is no per-job scope or exception capture. Under Quartz 4 the listener would never be called, so it logs an error pointing to Sentry.Quartz.

Craft creates the release-registry entry on the first release, from the nuget:Sentry.Quartz3 entry added to .craft.yml.

Stacked on #5505 by @michaelmairegger, which is still open. The base branch danf/quartz-5505-rebased is a copy of its branch.
Docs: getsentry/sentry-docs#19790

Closes #3150

@codecov

codecov Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.77778% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.32%. Comparing base (85c8a62) to head (b3446f4).

Files with missing lines Patch % Lines
src/Sentry.Quartz3/SentryJobListener.cs 66.66% 7 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5668      +/-   ##
==========================================
- Coverage   76.32%   76.32%   -0.01%     
==========================================
  Files         528      530       +2     
  Lines       19514    19551      +37     
  Branches     3808     3819      +11     
==========================================
+ Hits        14894    14922      +28     
- Misses       3742     3749       +7     
- Partials      878      880       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@wedamija
wedamija changed the base branch from main to danf/quartz4-crons October 6, 2026 02:03
@wedamija wedamija changed the title feat: add Sentry.Quartz for cron monitoring of Quartz.NET jobs feat: add Sentry.Quartz3 for cron monitoring of Quartz.NET 3.x jobs Oct 6, 2026
… dependencies and streamlining SentryCronJobListener options handling
… collection parameter and streamlining option configuration
…dSentryScope method, update SentryMetricsMiddleware to support configurable options
This was referenced Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for Crons on Quartz

3 participants